=head1 NAME

image_to_j2k - convert a PNM, PGM, PPM, PGX or BMP into a J2K or JP2 file


=head1 SYNOPSIS

=for
	TODO: Eventually introduce B<>'s and I<>'s in the synopsis
	line, but that might be tedious for a non-obvious benefit.
=cut

B<image_to_j2k> -i source -o destination [-cinema2k] [-cinema4k] [-r ratios | -q psnr] [-n rescount] [-b blocksize] [-c precintsize] [-t tilesize] [-p progression] [-s subsampling] [-POC orders] [-SOP] [-EPH] [-M modeflags] [-x indexfile] [-ROI:quantize] [-d imageoffset] [-T tileoffset] [-I]
image_to_j2k -ImgDir sourcedir -OutFor extension [-cinema2k] [-cinema4k] [-r ratios | -q psnr] [-n rescount] [-b blocksize] [-c precintsize] [-t tilesize] [-p progression] [-s subsampling] [-POC orders] [-SOP] [-EPH] [-M modeflags] [-x indexfile] [-ROI:quantize] [-d imageoffset] [-T tileoffset] [-I]
image_to_j2k -h


=head1 DESCRIPTION

image_to_j2k converts an image into a JPEG 2000-encoded image


=head1 OPTIONS

=over

=item B<-ImgDir> I<sourcedir>

Directory of PGM, PPM, PNM, PGX or BMP files to convert

=item B<-OutFor> I<extension>

J2K or JP2 output file format

=item B<-i> I<source>

PNM, PGM or PPM file to convert

=item B<-o> I<destination>

J2K or JP2 file to output to

=item B<-h>

Display help information

=item B<-cinema2k> I<fps>

Digital Cinema 2K profile compliant codestream for 2K resolution. 24 or 48 fps.

=item B<-cinema4k> [I<fps>]

Digital Cinema 4K profile compliant codestream for 4K resolution. fps default is 24

=item B<-r> I<ratios>

compression factor for successive layers, comma seperated

=item B<-q> I<psnr>

psnr for successive layers, comma seperated

=item B<-n> I<rescount>

number of resolutions

=item B<-b> I<blocksize>

width and height of code block, comma-seperated

=item B<-c> I<precintsize>

width and height of precinct, comma-seperated

=item B<-t> I<tilesize>

width and height of tile, comma-seperated

=item B<-p> I<progression>

progression order, one of LRCP, RLCP, RPCL, PCRL, CPRL

=item B<-s> I<subsampling>

subsampling factor in X and Y, comma-seperated. Values larger than 2 can produce errors

=item B<-POC> I<orders>

progression order change

=item B<-SOP>

write SOP marker before each packet

=item B<-EPH>

write EPH marker after each header packet

=item B<-M> I<modeflags>

Sum of the values of the modes, as follows:

=over

=item 1. BYPASS (LAZY)

=item 2. RESET

=item 4. RESTART (TERMALL)

=item 8. VSC

=item 16. ERTERM (SEGTERM)

=item 32. SEGMARK (SEGSYM)

=back

=for
	TODO: a line bre3ak seems to be missing here. I don't know how to
	handle this one. Please let me know when you've found how to
	do it. :)
=cut

=item B<-x> I<indexfile>

create an index file

=item B<-ROI:>I<quantize>

quantization indices upshifted for component c between 0 and 2 inclusive with an upshift of U between 0 and 37 inclusive

=item B<-d> I<imageoffset>

X and Y offset of the origin of the image, comma-seperated

=item B<-T> I<tileoffset>

X and Y offset of the origin of the tiles, comma-seperated

=item B<-I>

use the irreversible DWT 9-7

=back


=head1 EXAMPLE

ratios: 20,10,1  Quality 1: compress 20x; Quality 2: compress 10x; Quality 3: lossless compression

psnr: 30,40,50

quantize: c=0,U=25

orders: T1=0,0,1,5,3,CPRL  Title 1: Resolution 0 start, component 0 start, layer 1 end, resolution 5 end, component 3 end, CPRL progression


=head1 AUTHOR

Written by Paul Hampson <Paul.Hampson@Pobox.com> based on the output of image_to_j2k -h as part of the Debian packaging of OpenJPEG


=head1 COPYRIGHT

Copyright 2007 Paul Hampson


=head1 SEE ALSO

L<j2k_to_image(1)>, L<http://www.openjpeg.org/index.php?menu=doc#encoder>
